package com.company.observer.v03;

public class Main {
    public static void main(String[] args) {
        Child child = new Child();
//        while (!child.isCry()){
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//            System.out.println("observer........");
//        }
        child.wakeUp();
    }
}

class Dad {
    public void feed() {
        System.out.println("Dad feeding.............");
    }
}


class Child {
    private boolean cry = false;
    private Dad dad = new Dad();

    public boolean isCry() {
        return cry;
    }

    public void wakeUp() {
        cry = true;
        dad.feed();
    }
}